<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>ajax</title>
		<script src="js/axios.min.js" ></script>
		<!-- 发起ajax请求,异步访问,局部刷新 -->
		<script src="js/vue.js"></script>
	</head>
	<body>
		<!-- 准备数据渲染区 -->
		<div id="app">
			{{info}}
		</div>
		<script>
			new Vue({
				el:"#app",
				data:{
					info:''
				},
				mounted:function(){//发起ajax请求
					axios.get('http://localhost:8080/car/get').then(
					//箭头语法,其中a表示服务器返回的数据,处理返回值
						a=>(
							this.info=a.data.brand
						)
					)
					
				}
			})
		</script>
			
	</body>
</html>
